<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <title>TODO supply a title</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <style>
            div{width:800px;margin:0 auto;background: #ccc;text-align: center;}
        </style>
    </head>
    <body>
        <div>
            <h1>留言板</h1>
            <form method="post" action="liuyan.php">
                <input type="text" name="liuyanban" placeholder="发表遗言">
                <input type="submit" value="发表">
            </form>
        </div>
        <div><ul>
            <?php 
//            echo file_get_contents("1.txt");
            $file= fopen("1.txt", "r+");
//            $line= fgets($file);
            while($line= fgets($file)){
                echo "<li>$line</li>";
            }
            fclose($file);
            ?>
            </ul>
        </div>
    </body>
</html>
